\(\int \text {csch}^3(c+d x) (a+b \tanh ^2(c+d x)) \, dx\) [7]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 51 \[ \int \text {csch}^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a-2 b) \text {arctanh}(\cosh (c+d x))}{2 d}-\frac {a \coth (c+d x) \text {csch}(c+d x)}{2 d}+\frac {b \text {sech}(c+d x)}{d} \]

[Out]

1/2*(a-2*b)*arctanh(cosh(d*x+c))/d-1/2*a*coth(d*x+c)*csch(d*x+c)/d+b*sech(d*x+c)/d

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3745, 466, 396, 213} \[ \int \text {csch}^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a-2 b) \text {arctanh}(\cosh (c+d x))}{2 d}-\frac {a \coth (c+d x) \text {csch}(c+d x)}{2 d}+\frac {b \text {sech}(c+d x)}{d} \]

[In]

Int[Csch[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

((a - 2*b)*ArcTanh[Cosh[c + d*x]])/(2*d) - (a*Coth[c + d*x]*Csch[c + d*x])/(2*d) + (b*Sech[c + d*x])/d

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 466

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-a)^(m/2 - 1)*(b*c - a*d)*x
*((a + b*x^2)^(p + 1)/(2*b^(m/2 + 1)*(p + 1))), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[(a + b*x^2)^(p + 1)*E
xpandToSum[2*b*(p + 1)*x^2*Together[(b^(m/2)*x^(m - 2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d))/(a + b*x^2)]
- (-a)^(m/2 - 1)*(b*c - a*d), x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IGtQ[
m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rule 3745

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m
 + 1)), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {x^2 \left (a+b-b x^2\right )}{\left (-1+x^2\right )^2} \, dx,x,\text {sech}(c+d x)\right )}{d} \\ & = -\frac {a \coth (c+d x) \text {csch}(c+d x)}{2 d}+\frac {\text {Subst}\left (\int \frac {-a+2 b x^2}{-1+x^2} \, dx,x,\text {sech}(c+d x)\right )}{2 d} \\ & = -\frac {a \coth (c+d x) \text {csch}(c+d x)}{2 d}+\frac {b \text {sech}(c+d x)}{d}-\frac {(a-2 b) \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\text {sech}(c+d x)\right )}{2 d} \\ & = \frac {(a-2 b) \text {arctanh}(\cosh (c+d x))}{2 d}-\frac {a \coth (c+d x) \text {csch}(c+d x)}{2 d}+\frac {b \text {sech}(c+d x)}{d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(123\) vs. \(2(51)=102\).

Time = 0.28 (sec) , antiderivative size = 123, normalized size of antiderivative = 2.41 \[ \int \text {csch}^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {a \text {csch}^2\left (\frac {1}{2} (c+d x)\right )}{8 d}+\frac {a \log \left (\cosh \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}-\frac {b \log \left (\cosh \left (\frac {1}{2} (c+d x)\right )\right )}{d}-\frac {a \log \left (\sinh \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {b \log \left (\sinh \left (\frac {1}{2} (c+d x)\right )\right )}{d}-\frac {a \text {sech}^2\left (\frac {1}{2} (c+d x)\right )}{8 d}+\frac {b \text {sech}(c+d x)}{d} \]

[In]

Integrate[Csch[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

-1/8*(a*Csch[(c + d*x)/2]^2)/d + (a*Log[Cosh[(c + d*x)/2]])/(2*d) - (b*Log[Cosh[(c + d*x)/2]])/d - (a*Log[Sinh
[(c + d*x)/2]])/(2*d) + (b*Log[Sinh[(c + d*x)/2]])/d - (a*Sech[(c + d*x)/2]^2)/(8*d) + (b*Sech[c + d*x])/d

Maple [A] (verified)

Time = 1.26 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.98

method result size
derivativedivides \(\frac {a \left (-\frac {\operatorname {csch}\left (d x +c \right ) \coth \left (d x +c \right )}{2}+\operatorname {arctanh}\left ({\mathrm e}^{d x +c}\right )\right )+b \left (\frac {1}{\cosh \left (d x +c \right )}-2 \,\operatorname {arctanh}\left ({\mathrm e}^{d x +c}\right )\right )}{d}\) \(50\)
default \(\frac {a \left (-\frac {\operatorname {csch}\left (d x +c \right ) \coth \left (d x +c \right )}{2}+\operatorname {arctanh}\left ({\mathrm e}^{d x +c}\right )\right )+b \left (\frac {1}{\cosh \left (d x +c \right )}-2 \,\operatorname {arctanh}\left ({\mathrm e}^{d x +c}\right )\right )}{d}\) \(50\)
risch \(-\frac {{\mathrm e}^{d x +c} \left (a \,{\mathrm e}^{4 d x +4 c}-2 b \,{\mathrm e}^{4 d x +4 c}+2 \,{\mathrm e}^{2 d x +2 c} a +4 b \,{\mathrm e}^{2 d x +2 c}+a -2 b \right )}{d \left ({\mathrm e}^{2 d x +2 c}-1\right )^{2} \left ({\mathrm e}^{2 d x +2 c}+1\right )}-\frac {a \ln \left ({\mathrm e}^{d x +c}-1\right )}{2 d}+\frac {\ln \left ({\mathrm e}^{d x +c}-1\right ) b}{d}+\frac {a \ln \left ({\mathrm e}^{d x +c}+1\right )}{2 d}-\frac {\ln \left ({\mathrm e}^{d x +c}+1\right ) b}{d}\) \(150\)

[In]

int(csch(d*x+c)^3*(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(-1/2*csch(d*x+c)*coth(d*x+c)+arctanh(exp(d*x+c)))+b*(1/cosh(d*x+c)-2*arctanh(exp(d*x+c))))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 924 vs. \(2 (47) = 94\).

Time = 0.27 (sec) , antiderivative size = 924, normalized size of antiderivative = 18.12 \[ \int \text {csch}^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\text {Too large to display} \]

[In]

integrate(csch(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

-1/2*(2*(a - 2*b)*cosh(d*x + c)^5 + 10*(a - 2*b)*cosh(d*x + c)*sinh(d*x + c)^4 + 2*(a - 2*b)*sinh(d*x + c)^5 +
 4*(a + 2*b)*cosh(d*x + c)^3 + 4*(5*(a - 2*b)*cosh(d*x + c)^2 + a + 2*b)*sinh(d*x + c)^3 + 4*(5*(a - 2*b)*cosh
(d*x + c)^3 + 3*(a + 2*b)*cosh(d*x + c))*sinh(d*x + c)^2 + 2*(a - 2*b)*cosh(d*x + c) - ((a - 2*b)*cosh(d*x + c
)^6 + 6*(a - 2*b)*cosh(d*x + c)*sinh(d*x + c)^5 + (a - 2*b)*sinh(d*x + c)^6 - (a - 2*b)*cosh(d*x + c)^4 + (15*
(a - 2*b)*cosh(d*x + c)^2 - a + 2*b)*sinh(d*x + c)^4 + 4*(5*(a - 2*b)*cosh(d*x + c)^3 - (a - 2*b)*cosh(d*x + c
))*sinh(d*x + c)^3 - (a - 2*b)*cosh(d*x + c)^2 + (15*(a - 2*b)*cosh(d*x + c)^4 - 6*(a - 2*b)*cosh(d*x + c)^2 -
 a + 2*b)*sinh(d*x + c)^2 + 2*(3*(a - 2*b)*cosh(d*x + c)^5 - 2*(a - 2*b)*cosh(d*x + c)^3 - (a - 2*b)*cosh(d*x
+ c))*sinh(d*x + c) + a - 2*b)*log(cosh(d*x + c) + sinh(d*x + c) + 1) + ((a - 2*b)*cosh(d*x + c)^6 + 6*(a - 2*
b)*cosh(d*x + c)*sinh(d*x + c)^5 + (a - 2*b)*sinh(d*x + c)^6 - (a - 2*b)*cosh(d*x + c)^4 + (15*(a - 2*b)*cosh(
d*x + c)^2 - a + 2*b)*sinh(d*x + c)^4 + 4*(5*(a - 2*b)*cosh(d*x + c)^3 - (a - 2*b)*cosh(d*x + c))*sinh(d*x + c
)^3 - (a - 2*b)*cosh(d*x + c)^2 + (15*(a - 2*b)*cosh(d*x + c)^4 - 6*(a - 2*b)*cosh(d*x + c)^2 - a + 2*b)*sinh(
d*x + c)^2 + 2*(3*(a - 2*b)*cosh(d*x + c)^5 - 2*(a - 2*b)*cosh(d*x + c)^3 - (a - 2*b)*cosh(d*x + c))*sinh(d*x
+ c) + a - 2*b)*log(cosh(d*x + c) + sinh(d*x + c) - 1) + 2*(5*(a - 2*b)*cosh(d*x + c)^4 + 6*(a + 2*b)*cosh(d*x
 + c)^2 + a - 2*b)*sinh(d*x + c))/(d*cosh(d*x + c)^6 + 6*d*cosh(d*x + c)*sinh(d*x + c)^5 + d*sinh(d*x + c)^6 -
 d*cosh(d*x + c)^4 + (15*d*cosh(d*x + c)^2 - d)*sinh(d*x + c)^4 + 4*(5*d*cosh(d*x + c)^3 - d*cosh(d*x + c))*si
nh(d*x + c)^3 - d*cosh(d*x + c)^2 + (15*d*cosh(d*x + c)^4 - 6*d*cosh(d*x + c)^2 - d)*sinh(d*x + c)^2 + 2*(3*d*
cosh(d*x + c)^5 - 2*d*cosh(d*x + c)^3 - d*cosh(d*x + c))*sinh(d*x + c) + d)

Sympy [F]

\[ \int \text {csch}^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right ) \operatorname {csch}^{3}{\left (c + d x \right )}\, dx \]

[In]

integrate(csch(d*x+c)**3*(a+b*tanh(d*x+c)**2),x)

[Out]

Integral((a + b*tanh(c + d*x)**2)*csch(c + d*x)**3, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 152 vs. \(2 (47) = 94\).

Time = 0.21 (sec) , antiderivative size = 152, normalized size of antiderivative = 2.98 \[ \int \text {csch}^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {1}{2} \, a {\left (\frac {\log \left (e^{\left (-d x - c\right )} + 1\right )}{d} - \frac {\log \left (e^{\left (-d x - c\right )} - 1\right )}{d} + \frac {2 \, {\left (e^{\left (-d x - c\right )} + e^{\left (-3 \, d x - 3 \, c\right )}\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} - e^{\left (-4 \, d x - 4 \, c\right )} - 1\right )}}\right )} - b {\left (\frac {\log \left (e^{\left (-d x - c\right )} + 1\right )}{d} - \frac {\log \left (e^{\left (-d x - c\right )} - 1\right )}{d} - \frac {2 \, e^{\left (-d x - c\right )}}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} \]

[In]

integrate(csch(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*a*(log(e^(-d*x - c) + 1)/d - log(e^(-d*x - c) - 1)/d + 2*(e^(-d*x - c) + e^(-3*d*x - 3*c))/(d*(2*e^(-2*d*x
 - 2*c) - e^(-4*d*x - 4*c) - 1))) - b*(log(e^(-d*x - c) + 1)/d - log(e^(-d*x - c) - 1)/d - 2*e^(-d*x - c)/(d*(
e^(-2*d*x - 2*c) + 1)))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 142 vs. \(2 (47) = 94\).

Time = 0.29 (sec) , antiderivative size = 142, normalized size of antiderivative = 2.78 \[ \int \text {csch}^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {{\left (a - 2 \, b\right )} \log \left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )} + 2\right ) - {\left (a - 2 \, b\right )} \log \left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )} - 2\right ) - \frac {4 \, {\left (a {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )}^{2} - 2 \, b {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )}^{2} + 8 \, b\right )}}{{\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )}^{3} - 4 \, e^{\left (d x + c\right )} - 4 \, e^{\left (-d x - c\right )}}}{4 \, d} \]

[In]

integrate(csch(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

1/4*((a - 2*b)*log(e^(d*x + c) + e^(-d*x - c) + 2) - (a - 2*b)*log(e^(d*x + c) + e^(-d*x - c) - 2) - 4*(a*(e^(
d*x + c) + e^(-d*x - c))^2 - 2*b*(e^(d*x + c) + e^(-d*x - c))^2 + 8*b)/((e^(d*x + c) + e^(-d*x - c))^3 - 4*e^(
d*x + c) - 4*e^(-d*x - c)))/d

Mupad [B] (verification not implemented)

Time = 1.86 (sec) , antiderivative size = 156, normalized size of antiderivative = 3.06 \[ \int \text {csch}^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (a\,\sqrt {-d^2}-2\,b\,\sqrt {-d^2}\right )}{d\,\sqrt {a^2-4\,a\,b+4\,b^2}}\right )\,\sqrt {a^2-4\,a\,b+4\,b^2}}{\sqrt {-d^2}}-\frac {a\,{\mathrm {e}}^{c+d\,x}}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}-1\right )}+\frac {2\,b\,{\mathrm {e}}^{c+d\,x}}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}-\frac {2\,a\,{\mathrm {e}}^{c+d\,x}}{d\,\left ({\mathrm {e}}^{4\,c+4\,d\,x}-2\,{\mathrm {e}}^{2\,c+2\,d\,x}+1\right )} \]

[In]

int((a + b*tanh(c + d*x)^2)/sinh(c + d*x)^3,x)

[Out]

(atan((exp(d*x)*exp(c)*(a*(-d^2)^(1/2) - 2*b*(-d^2)^(1/2)))/(d*(a^2 - 4*a*b + 4*b^2)^(1/2)))*(a^2 - 4*a*b + 4*
b^2)^(1/2))/(-d^2)^(1/2) - (a*exp(c + d*x))/(d*(exp(2*c + 2*d*x) - 1)) + (2*b*exp(c + d*x))/(d*(exp(2*c + 2*d*
x) + 1)) - (2*a*exp(c + d*x))/(d*(exp(4*c + 4*d*x) - 2*exp(2*c + 2*d*x) + 1))